money = 50000
l = []
thing = ['水', '薯片', '糖果', '可乐', '纸巾', '杯子', '牙刷']
price = [2, 10, 6, 8, 20, 100, 30]
while money != 0 and thing != 0:
    a = input("请输入商品：")
    if a in thing:
        print("有这个商品")
        b = thing.index(a)
        c = price[b]
        if money >= c:
            l.append(a)
            money -= c
            print("恭喜，购买成功！您的卡余额还剩：%d" % money)
            t = input("是否继续购物：")
            if t =='是':
                continue
            elif t =='否':
                input("请输入q或Q退出：")
                print('您购买了：' + str(l) + '，您还剩：%d' %money)
                break
        elif money < c:
            print("穷鬼，钱不够！请到其他超市购买！")
    else:
        print("没有这个商品，别瞎搞！")
    input("请输入q或Q退出：")
    print('您什么都没有买，卡余额还剩：%d'% money)
    break
else:
    print("无法购物")